{
  "$schema" : "http://json-schema.org/draft/2019-09/schema#",
  "title" : "Reversal Batch Extract",
  "type" : "object",
  "additionalProperties" : false,
  "properties" : {
    "identifier" : {
      "type" : "integer",
      "description" : "Unique identifier for each file that is produced or processed by CMP"
    },
    "version" : {
      "type" : "number",
      "minimum" : 0.0,
      "maximum" : 99.99,
      "description" : "The current version of the generic extract file. This must match the corresponding inbound file."
    },
    "interfaceCategory" : {
      "type" : "string",
      "enum" : [ "Payments" ],
      "description" : "CMP categorisation of the job associated with this file"
    },
    "interfaceType" : {
      "type" : "string",
      "enum" : [ "Reversal" ],
      "description" : "Sub-categorisation of the job"
    },
    "batchDateTime" : {
      "type" : "string",
      "format" : "date-time",
      "description" : "Represents when a batch was created in CMP"
    },
    "extractLoadDateTime" : {
      "type" : "string",
      "format" : "date-time",
      "description" : "Timestamp indicating when the generic extract file was created."
    },
    "recordCount" : {
      "type" : "integer",
      "description" : "Total number of transaction records in the extract file. "
    },
    "details" : {
      "type" : "array",
      "items" : {
        "$ref" : "#/definitions/ReversalBatchDetailExtract"
      }
    }
  },
  "required" : [ "identifier", "version", "interfaceCategory", "interfaceType", "batchDateTime", "extractLoadDateTime", "recordCount" ],
  "definitions" : {
    "ReversalBatchDetailExtract" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "detailSequence" : {
          "type" : "integer",
          "description" : "Unique identifier of the detail record within the current extract"
        },
        "accountNumber" : {
          "type" : "integer",
          "description" : "Unique identifier of the account in CMP."
        },
        "amount" : {
          "type" : "number",
          "minimum" : 0.0,
          "maximum" : 9.999999999999E10,
          "description" : "Amount of the payment or refund."
        },
        "documentType" : {
          "type" : "string",
          "description" : "Payment or refund indicator."
        },
        "documentNumber" : {
          "type" : "integer",
          "description" : "Unique identifier of the payment/refund transaction."
        }
      },
      "required" : [ "detailSequence", "accountNumber", "amount", "documentType", "documentNumber" ]
    }
  }
}